/* 
 * File:   main.c
 * Author: fire
 *
 * Created on November 13, 2009, 6:31 AM
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "PF_UTIL.h"
#include "ADD_SUB.h"
#include "simparameters.h"
#include "MULT.h"
/*
 * 
 */
int main(int argc, char** argv) {
    //My input oprands
    //char Mx_str[] ="00000100100010011101111111111111";
    char Mx_str2[] ="11000101000111111000111001";
    //char My_str[] ="00000101111111000000000001000000";
    char Mx_str[] ="00000101100000000001111111111111";
    char My_str[] ="11000111111111000000000001000000";
    char *test;
    int i;
    FPOINT_PTR Mx;
    FPOINT_PTR My;
    FPOINT_PTR Result;
    char *MxExponMult=(char *)malloc(sizeof(char)*(EXPONENT_WIDTH+2));
    char *MyExponMult=(char *)malloc(sizeof(char)*(EXPONENT_WIDTH+2));
    MxExponMult[0]='1';
    MyExponMult[0]='1';


    Mx=CreateFP(Mx_str);
    My=CreateFP(My_str);


    for(i=1;i<EXPONENT_WIDTH+2;i++){
        MxExponMult[i]=Mx->Exponent[i-1];
        MyExponMult[i]=My->Exponent[i-1];
    }

    //initialize the explicit one.
    
    printf("%s\n",Mx->Exponent);
    printf("%s\n",MxExponMult);
    printf("%s\n",My->Exponent);
    printf("%s\n",MyExponMult);
    //strcat (MyExponMult,My->Exponent);

    //test=MbyMMulttplier(MxExponMult,MyExponMult,EXPONENT_WIDTH+1);

    //printf("%s\n",test);
    //printf("Mx: Sign(%d), Exponent(%s), Fraction(%s)\n",Mx->sign-48, Mx->Exponent, Mx->Fraction );
    //printf("Mx: Exponent_INT(%d), Fraction_INT(%d)\n",Mx->Exponent_INT, Mx->Fraction_INT );

    //binary2INT(Mx->Exponent,EXPONENT_WIDTH);
    //Result=Add(Mx,My,0);
    //printf("%s\n",Mx_str2);

    
    
    //free(Result);
    return (EXIT_SUCCESS);
}

